<template>
  <InlineLayout title-name="在职人员审核列表">
    <template #header>
      <my-form ref="ruleForm" v-model:modelValue="dataForm" :model="dataForm" :items-datas="itemsDatas">
        <my-button type="reset" title="重置" @click="reset" />
        <my-button type="search" title="查询" :loading="loading" @click="search" />
      </my-form>
    </template>

    <template #titleTools>
      <my-button type="export" title="人员信息导出" @click="openClick" />
    </template>

    <my-table :columns="columns" :table-data="tableData">
      <template #operation="scope">
        <my-button type="text">附件</my-button>
        <my-button type="text">详情</my-button>
        <my-button type="text">比对</my-button>
        <my-button type="text" @click="handleAudit(scope.row)">审核</my-button>
        <my-button type="text" @click="handleRecord(scope.row)">审核记录</my-button>
      </template>
    </my-table>
    <template #footer>
      <pagination v-model:page="dataForm.pageNum" v-model:limit="dataForm.pageSize" :total="total" @pagination="getList" />
    </template>
  </InlineLayout>
  <audit v-model="isShow" :current-row="currentRow" @audit-sumit="auditSumit" />
  <auditRecord v-model="recordShow" :current-row="currentRow" />
</template>
<script setup>
import { ref, onMounted } from 'vue';
import audit from '@/views/components/audit/index.vue';
import auditRecord from './components/auditRecord.vue';
const total = 0;
const recordShow = ref(false);
const state = reactive({
  dataForm: {
    pageNum: 1,
    pageSize: 10
  },
  isShow: false,
  currentRow: {},
  itemsDatas: [
    { label: '身份证号码', prop: 'medType', type: 'input' },
    { label: '姓名', prop: 'medType', type: 'input' }
  ],
  tableData: [{}],
  columns: [
    { label: '序号', type: 'index', width: '55', prop: 'index' },
    { label: '统筹区编码', prop: 'rchkFlag', align: 'center' },
    { label: '个人编号', prop: 'rchkFlag', align: 'center' },
    { label: '身份证号码', prop: 'rchkFlag', align: 'center' },
    { label: '姓名', prop: 'rchkFlag', align: 'center' },
    { label: '个人账号', prop: 'rchkFlag', align: 'center' },
    { label: '性别', prop: 'rchkFlag', align: 'center' },
    { label: '出生年月', prop: 'rchkFlag', align: 'center' },
    { label: '民族', prop: 'rchkFlag', align: 'center' },
    { label: '数据状态', prop: 'rchkFlag', align: 'center' },
    { label: '操作', type: 'operation', minWidth: '160px' }
  ]
});
const { itemsDatas, tableData, columns, dataForm, isShow, currentRow } = toRefs(state);
//列表初始化
const getList = () => {};
const openClick = () => {};
//重置
const reset = () => {};
//查询
const search = () => {
  getList();
};
//显示审核弹窗
const handleAudit = (row) => {
  isShow.value = true;
};
//审核记录
const handleRecord = (row) => {
  recordShow.value = true;
};
//审核
const auditSumit = (data) => {
  console.log(data);
};
onMounted(() => {
  getList();
});
</script>
